//
//  HTBaseViewController.m
//  HeartTravel
//
//  Created by lanou on 15/10/24.
//  Copyright © 2015年 陈文杰. All rights reserved.
//

#import "HTBaseViewController.h"

@interface HTBaseViewController ()

@end

@implementation HTBaseViewController
- (UIView *)topView {
    
    if (!_topView) {
        _topView = [[UIView alloc] initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 50)];
        _leftButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _leftButton.frame = CGRectMake(10, 15, 20, 20);

        _rightButton = [UIButton buttonWithType:(UIButtonTypeCustom)];
        _rightButton.frame = CGRectMake(SCREEN_WIDTH - 50, 10, 30, 30);
        
        _topView.backgroundColor = [UIColor blackColor];
//        _rightButton.backgroundColor = [UIColor whiteColor];
        
        [_topView addSubview:_leftButton];
        [_topView addSubview:_rightButton];
        [_topView addSubview:self.titleLabel];
        [self.view addSubview:_topView];
    }
    return _topView;
    
}

- (UILabel *)titleLabel {
    
    if (!_titleLabel) {
        _titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(SCREEN_WIDTH/2 - 75, 10, 150, 30)];
        _titleLabel.textAlignment = NSTextAlignmentCenter;
        _titleLabel.textColor = [UIColor whiteColor];
    }
    return _titleLabel;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    NSLog(@"%@", self.topView);
//    self.view.backgroundColor = [UIColor blackColor];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
